<template>
  <el-row>
    <el-col :span="14" :offset="5">
      <div id="container">
        <div>
          <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="用户名">
              <el-input v-model="form.userName" type="" />
            </el-form-item>
            <el-form-item label="密码" prop="pass">
              <el-input v-model="form.passWord" type="password" autocomplete="off" />
            </el-form-item>
          </el-form>
          <el-row type="flex" class="row-bg" justify="space-around">
            <el-button>登录</el-button>
          </el-row>
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<script>
import { mapState, mapMutations, mapActions } from 'vuex'

export default {
  name: 'Login',
  data() {
    return {
      form: {
        userName: '',
        passWord: ''
      }
    }
  },
  computed: {
    ...mapState(['count'])
  },
  methods: {
    ...mapMutations(['sub']),
    ...mapActions(['addAsync']),
    handle() {
      this.$store.dispatch('addAsync')
    },
    handleSub() {
      this.sub()
    }
  }
}
</script>

<style scoped>
#container {
  border-radius: 3rem;
  margin-top: 8rem;
  border: 2px solid grey;
  padding: 50px 0 50px 0;
  width: 100%;
  display: flex;
  justify-content: center;
}
</style>
